import 'package:ad_x_sdk/ad_x_sdk.dart';
import 'package:ad_x_sdk_example/com/qlslylq/flutterdesign/constant/KeyConstant.dart';
import 'package:flutter/material.dart';
import 'package:ad_x_sdk_example/com/qlslylq/flutterdesign/scene/BaseScene.dart';

import 'SplashAdTestScene.dart';

/*
 * 开屏广告测试主页 <br/>
 * 需要传入的键：<br/>
 * 传入的值类型： <br/>
 * 传入的值含义：<br/>
 * 是否必传 ：
 */
class SplashAdTestMainScene extends BaseScene {
  State<StatefulWidget> createState() {
    return new SplashAdTestMainSceneState();
  }
}

/*
 * 页面功能 <br/>
 */
class SplashAdTestMainSceneState extends BaseSceneState {
  SplashAdTestMainSceneState() {
    title = '开屏广告测试';
  }

  void initState() {
    super.initState();
  }

  Widget build(BuildContext context) {
    var listTileHeight = 33.5;
    var listTileMargin = EdgeInsets.fromLTRB(50, 0, 50, 0);

    return buildBody(
        context,
        new Column(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              new Container(
                width: MediaQuery.of(context).size.width,
                height: listTileHeight,
                margin: listTileMargin,
                child: new RaisedButton(
                  onPressed: () {
                    switchingScene(new SplashAdTestScene(isHalf: true));
                  },
                  child: new Text('展示（半屏）'),
                  color: Theme.of(context).buttonColor,
                  shape: Border.all(
                      color: Colors.green, style: BorderStyle.solid, width: 1),
                ),
              ),
              new Container(
                width: MediaQuery.of(context).size.width,
                height: listTileHeight,
                margin: listTileMargin,
                child: new RaisedButton(
                  onPressed: () {
                    switchingScene(new SplashAdTestScene(isHalf: false));
                  },
                  child: new Text('展示（全屏）'),
                  color: Theme.of(context).buttonColor,
                  shape: Border.all(
                      color: Colors.blue, style: BorderStyle.solid, width: 1),
                ),
              ),
              new Container(
                width: MediaQuery.of(context).size.width,
                height: listTileHeight,
                margin: listTileMargin,
                child: new RaisedButton(
                  onPressed: () {
                    showToast("正在开发中~");
                  },
                  child: new Text('其它功能'),
                  color: Theme.of(context).buttonColor,
                  shape: Border.all(
                      color: Colors.yellow, style: BorderStyle.solid, width: 1),
                ),
              ),
            ]));
  }

  void onClick(Widget widget) {}
}
